# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-camertron-eprun
_gemname=${pkgname#ruby-}
pkgver=1.1.1
pkgrel=5
pkgdesc='Efficient Pure Ruby Unicode Normalization.'
arch=('any')
url='https://github.com/camertron/camertron-eprun'
license=('custom:Ruby')
depends=('ruby')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('f04798097d516f6f409b71737f5045b5f208016e261ba09dde04a9b6620daa76b6f35d5268e8e4acbd5f468175defbe0a127255bb2d86bb7b6a7065c9f94ee52')

package() {
  _gemhome="$(gem env home)"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemhome" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm "$pkgdir/$_gemhome/cache/$_gemname-$pkgver.gem"

  install -Dm 644 "$pkgdir/$_gemhome/gems/$_gemname-$pkgver/LICENSE" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

